package com.sqrj.phoneorder.Controller;


import com.sqrj.phoneorder.common.JsonData;
import com.sqrj.phoneorder.model.GybWeighRecord;
import com.sqrj.phoneorder.param.WeighCountParam;
import com.sqrj.phoneorder.service.SysWeighCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;


@RestController
public class SysWeightCountController {
    @Autowired
    private SysWeighCountService sysWeighCountService;

    //按客户
    @PostMapping("/queryWeightProUnit")
    @ResponseBody
    public JsonData getWeighCountByCustomer(@RequestBody WeighCountParam weighCountParam){

        return JsonData.success(sysWeighCountService.getWeighCountByProUnit(weighCountParam));
    }

    //查询客户集合
    @PostMapping("/queryWeightCustomerList")
    public JsonData queryWeightCustomerList(@RequestBody WeighCountParam weighCountParam){

        return JsonData.success(sysWeighCountService.queryWeightCustomerList(weighCountParam));
    }


    //按车牌号
    @RequestMapping("/queryWeightTruckCount")
    @ResponseBody
    public JsonData getWeighCountByTruck(@RequestBody WeighCountParam weighCountParam){

        return JsonData.success(sysWeighCountService.getWeighCountByTruck(weighCountParam));
    }

    //查询车牌号集合
    @PostMapping("/queryWeightTruckList")
    public JsonData queryWeightTruckList(@RequestBody WeighCountParam weighCountParam){

        return JsonData.success(sysWeighCountService.queryWeightTruckList(weighCountParam));
    }

    //按存放位置
    @PostMapping("/queryWeightStorageCount")
    public JsonData getWeighCountByStorage(@RequestBody WeighCountParam weighCountParam){

        return JsonData.success(sysWeighCountService.getWeighCountByStorage(weighCountParam));
    }

    //查询存放位置集合
    @PostMapping("/queryWeightStorageList")
    public JsonData queryWeightStorageList(@RequestBody WeighCountParam weighCountParam){

        return JsonData.success(sysWeighCountService.queryWeightStorageList(weighCountParam));
    }

    //按货物名称
    @PostMapping("/queryWeightTypeCount")
    public JsonData getWeighCountByName(@RequestBody WeighCountParam weighCountParam){

        return JsonData.success(sysWeighCountService.getWeighCountByName(weighCountParam));
    }

    //查询货物名称集合
    @PostMapping("/queryWeightTypeList")
    public JsonData queryWeightTypeList(@RequestBody WeighCountParam weighCountParam){

        return JsonData.success(sysWeighCountService.queryWeightTypeList(weighCountParam));
    }

    //查询过磅明细
    @PostMapping("/queryWeightRecord")
    public JsonData querySendRecord(@RequestBody WeighCountParam weighCountParam) {

        List<GybWeighRecord> sendTruckOUTList = sysWeighCountService.queryWeightRecord(weighCountParam);

        return  JsonData.success(sendTruckOUTList);
    }


}
